package com.socodethis.spaceex;

import com.badlogic.gdx.graphics.g2d.Sprite;

public class SpriteProperties {
	//The string used to identify the sprite in the texturePackerLoaderClass
	private String name;
	//Da pic
	private Sprite sprite;
	private float height;
	//I just defined the different tile properties here until I can find a better place to put them
	//Makes the class a bit unwieldy. Def need to fix this
	private boolean[] properties = new boolean[6];
	/* 
	 * 0 - isNotPassable
	 * 1 - isExit
	 * 2 - isSwitch
	 * 3 - isDoor
	 * 4 - isFlippedDoor
	 * 5 - isMovableBox
	 */
	SpriteProperties(SpriteProperties sprite){
		this.name = sprite.name;
		this.sprite = new Sprite(sprite.sprite);
		//for(int i = 0; i < sprite.properties.length;i++){
		this.properties = sprite.properties;
		this.height = height;
		//}
	}
	SpriteProperties(String name, Sprite sprite, int height){
		this.sprite = new Sprite(sprite);
		this.name = name;
		for(int i = 0; i < this.properties.length;i++){
			properties[i] = false;
		}
	}
	public String getName(){
		return name;
	}
	public Sprite getSprite(){
		return sprite;
	}
	public float getHeight(){
		return height;
	}
	public void setHeight(float height){
		this.height = height;
	}
	public void setSprite(Sprite sprite){
		this.sprite = new Sprite(sprite);
	}
	
	public void setPropAtIndex(int index, boolean property){
		properties[index] = property;
	}
	
	public boolean getPropAtIndex(int index){
		return properties[index];
	}
	public int getPropSize(){
		return properties.length;
	}
	public boolean anyProperties(){
		for(int i = 0; i < this.properties.length;i++){
			if(properties[i]){
				return true;
			}
		}
		return false;
	}
}
